using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace S.M.SmartMedical.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class SeedMedicalProjectsData : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            // 插入医疗项目测试数据
            migrationBuilder.InsertData(
                table: "MedicalProjects",
                columns: new[] { "Name", "Description", "Price", "Category", "HospitalAreaId", "Code", "IsEnabled", "SortOrder", "Tags", "EstimatedDuration", "PreparationInstructions", "CreateTime", "CreateUserName", "IsDeleted" },
                values: new object[,]
                {
                    // 检验项目 - 总院
                    { "血常规", "检测血液中各种细胞成分和血红蛋白等指标", 25.00m, 0, 1, "LAB001", true, 1, "常规检查,血液", 30, "检查前无需特殊准备，正常饮食即可", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "尿常规", "检测尿液中的各种成分，评估肾功能和泌尿系统健康", 15.00m, 0, 1, "LAB002", true, 2, "常规检查,尿液", 20, "留取中段尿液，女性避开月经期", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "肝功能", "检测肝脏功能相关的生化指标", 45.00m, 0, 1, "LAB003", true, 3, "生化检查,肝脏", 60, "检查前需空腹8-12小时", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "肾功能", "检测肾脏功能相关的生化指标", 35.00m, 0, 1, "LAB004", true, 4, "生化检查,肾脏", 60, "检查前需空腹8-12小时", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "血糖", "检测血液中葡萄糖浓度", 8.00m, 0, 1, "LAB005", true, 5, "生化检查,糖尿病", 15, "空腹检查或餐后2小时检查", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    
                    // 检查项目 - 总院
                    { "胸部X光", "胸部X线摄影检查，用于诊断肺部和心脏疾病", 80.00m, 1, 1, "RAD001", true, 11, "影像检查,胸部", 15, "检查时需脱去上身衣物，佩戴防护用品", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "腹部B超", "腹部超声检查，用于检查肝、胆、胰、脾、肾等器官", 120.00m, 1, 1, "US001", true, 12, "超声检查,腹部", 30, "检查前需空腹8小时，检查前1小时饮水500ml憋尿", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "心电图", "记录心脏电活动，用于诊断心律失常和心脏疾病", 30.00m, 1, 1, "ECG001", true, 13, "心电检查,心脏", 10, "检查前避免剧烈运动，保持安静", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "CT头颅", "头颅CT扫描，用于诊断脑部疾病", 280.00m, 1, 1, "CT001", true, 14, "CT检查,头部", 20, "检查时需取下金属饰品，保持头部不动", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "MRI膝关节", "膝关节磁共振成像检查", 450.00m, 1, 1, "MRI001", true, 15, "MRI检查,关节", 45, "检查前取下所有金属物品，告知是否有金属植入物", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    
                    // 检验项目 - 东院
                    { "血常规", "检测血液中各种细胞成分和血红蛋白等指标", 25.00m, 0, 2, "LAB001_E", true, 1, "常规检查,血液", 30, "检查前无需特殊准备，正常饮食即可", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "尿常规", "检测尿液中的各种成分，评估肾功能和泌尿系统健康", 15.00m, 0, 2, "LAB002_E", true, 2, "常规检查,尿液", 20, "留取中段尿液，女性避开月经期", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "肝功能", "检测肝脏功能相关的生化指标", 45.00m, 0, 2, "LAB003_E", true, 3, "生化检查,肝脏", 60, "检查前需空腹8-12小时", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    
                    // 检查项目 - 东院
                    { "胸部X光", "胸部X线摄影检查，用于诊断肺部和心脏疾病", 80.00m, 1, 2, "RAD001_E", true, 11, "影像检查,胸部", 15, "检查时需脱去上身衣物，佩戴防护用品", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "腹部B超", "腹部超声检查，用于检查肝、胆、胰、脾、肾等器官", 120.00m, 1, 2, "US001_E", true, 12, "超声检查,腹部", 30, "检查前需空腹8小时，检查前1小时饮水500ml憋尿", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "心电图", "记录心脏电活动，用于诊断心律失常和心脏疾病", 30.00m, 1, 2, "ECG001_E", true, 13, "心电检查,心脏", 10, "检查前避免剧烈运动，保持安静", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    
                    // 检验项目 - 西院
                    { "血常规", "检测血液中各种细胞成分和血红蛋白等指标", 25.00m, 0, 3, "LAB001_W", true, 1, "常规检查,血液", 30, "检查前无需特殊准备，正常饮食即可", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "尿常规", "检测尿液中的各种成分，评估肾功能和泌尿系统健康", 15.00m, 0, 3, "LAB002_W", true, 2, "常规检查,尿液", 20, "留取中段尿液，女性避开月经期", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    
                    // 检查项目 - 西院
                    { "胸部X光", "胸部X线摄影检查，用于诊断肺部和心脏疾病", 80.00m, 1, 3, "RAD001_W", true, 11, "影像检查,胸部", 15, "检查时需脱去上身衣物，佩戴防护用品", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false },
                    { "心电图", "记录心脏电活动，用于诊断心律失常和心脏疾病", 30.00m, 1, 3, "ECG001_W", true, 13, "心电检查,心脏", 10, "检查前避免剧烈运动，保持安静", new DateTime(2024, 8, 6, 12, 0, 0), "系统管理员", false }
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            // 删除医疗项目测试数据
            migrationBuilder.DeleteData(
                table: "MedicalProjects",
                keyColumn: "Code",
                keyValues: new object[] { "LAB001", "LAB002", "LAB003", "LAB004", "LAB005", "RAD001", "US001", "ECG001", "CT001", "MRI001", "LAB001_E", "LAB002_E", "LAB003_E", "RAD001_E", "US001_E", "ECG001_E", "LAB001_W", "LAB002_W", "RAD001_W", "ECG001_W" });
        }
    }
}
